package com.motherchild.user.service.impl;

import com.motherchild.admin.dto.ProductDTO;
import com.motherchild.admin.mapper.ProductMapper;
import com.motherchild.admin.service.ProductService;
import com.motherchild.admin.vo.CategoryVO;
import com.motherchild.admin.vo.PageVO;
import com.motherchild.admin.vo.ProductDetailVO;
import com.motherchild.common.exception.BusinessException;
import com.motherchild.user.mapper.UserProductMapper;
import com.motherchild.user.service.UserProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.List;
import java.util.UUID;

@Service
public class UserProductServiceImpl implements UserProductService {

    @Autowired
    private UserProductMapper productMapper;

    @Override
    public List<ProductDetailVO> getList( Integer categoryId,String keyword) {
        List<ProductDetailVO> list = null;
        try {
            list = productMapper.selectList(categoryId, keyword);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

    @Override
    public List<ProductDetailVO> getHot() {
        List<ProductDetailVO> list = null;
        try {
            list = productMapper.getHot();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}